package com.bootx.redis;

import com.bootx.redis.listener.RedisKeyExpirationListener;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.Resource;

@SpringBootApplication
@ComponentScan("com.bootx")
public class RedisExpirationNoticeApplication implements CommandLineRunner {

    public static void main(String[] args) {
        new SpringApplicationBuilder(RedisExpirationNoticeApplication.class)
                .run(args);
    }

    @Resource
    RedisKeyExpirationListener redisKeyExpirationListener;

    @Override
    public void run(String... args){
        redisKeyExpirationListener.startListener();
    }

}
